package demo;

import java.util.Random;
import java.util.Scanner;

public class Test_Marriage {
    public static void main(String[] args) {
        // 相同的hash值每次的随机数都是一样的
        Scanner sc = new Scanner(System.in);
        System.out.println("测试您的姻缘~");
        System.out.println("请您输入男士姓名：");
        String boy = sc.nextLine();
        System.out.println("请您输入女士姓名：");
        String girl = sc.nextLine();
        Random ran = new Random(boy.hashCode() + girl.hashCode());
        int i = ran.nextInt(101);
        System.out.println(i);
    }
}
